﻿@page "/DataStandard/DataStandardConfig"
<PageTitle>数据标准配置</PageTitle>
@inherits ComponentBaseDataCenter
<div>
    <h3>数据标准配置</h3>

    <Table @ref="table" TItem="DataStandardConfigVO" UseInjectDataService="false" IsPagination="true" PageItemsSource="PageItems" DoubleClickToEdit="true"
           IsStriped="true" IsBordered="true" ShowSkeleton="true" IsMultipleSelect="true" ShowEmpty="true" ShowLoading="true" ShowColumnList="true"
           ShowToolbar="true" ShowExtendButtons="true"
           ShowSearch="true" ShowAdvancedSearch="false"
           AutoGenerateColumns="true" EditMode="EditMode.Popup" style="height:84vh"
           OnQueryAsync="QueryAsync" OnSaveAsync="@OnSaveAsync" OnDeleteAsync="OnDeleteAsync" ShowToastAfterSaveOrDeleteModel="false">
        @* <TableToolbarTemplate>
        <TableToolbarButton TItem="DataStandardConfigVO" Icon="fa-fw fa-solid fa-plus" IsEnableWhenSelectedOneRow="false" Text="添加" OnClickCallback="@OnAddClickAsync" Color="Color.Success" />
        <TableToolbarButton TItem="DataStandardConfigVO" Icon="fa-fw fa-solid fa-pencil" IsEnableWhenSelectedOneRow="true" Text="编辑" OnClickCallback="@OnEditClickAsync" Color="Color.Primary" />
        <TableToolbarButton TItem="DataStandardConfigVO" Icon="fa-fw fa-solid fa-xmark" IsEnableWhenSelectedOneRow="true" Text="删除" OnClickCallback="@OnDeleteClickAsync" Color="Color.Danger" />
        <TableToolbarButton TItem="DataStandardConfigVO" Icon="fa-fw fa-solid fa-pen-to-square" IsEnableWhenSelectedOneRow="true" Text="@Localizer["WidthButtonText4"]" OnClickCallback="@CustomerButton" Color="Color.Danger" />
        </TableToolbarTemplate>*@
        <TableToolbarTemplate>
            <TableToolbarButton Color="Color.Info" TItem="DataStandardConfigVO" Icon="fas fa-copy" Text="复制" IsAsync OnClickCallback="@CopyItemsAsync" />
         </TableToolbarTemplate>

         @*<TableToolbarTemplate>
        <TableToolbarButton TItem="MQTTConfigVO" Icon="fa-fw fa-solid fa-pen-to-square" IsEnableWhenSelectedOneRow="true" Text="测试" Color="Color.Primary" />
        </TableToolbarTemplate>*@
         <EditTemplate>
             <DataStandardConfigEditView Config="@context" />
             @* <div class="row g-3 form-inline">
            <div class="col-12 col-sm-6">
            <BootstrapInput @bind-Value="@context.Name" placeholder="不可为空，50字以内" maxlength="50" />
            </div>
            <div class="col-12 col-sm-6">
            <Select @bind-Value="@context.Type" Items="@DbTypeItems" placeholder="不可为空，50字以内" maxlength="50" OnSelectedItemChanged="@(x=>OnSelectedItemChangedAsync(x,context))" />
            </div>
            <div class="col-12 col-sm-12">
            <BootstrapInput @bind-Value="@context.ConnStr" placeholder="请输入连接字符串" @ref="bootstrapInput" />
            </div>
            </div>*@
         </EditTemplate>
         <RowButtonTemplate>
             @*<TableCellButton Color="Color.Info" Icon="fa-solid fa-pen" Text="测试连接" OnClick="@(()=>OnConnTestAsync(context))" IsAsync="true" />*@
             @*<TableCellPopconfirmButton Color="Color.Info" Icon="fa-solid fa-pen" Text="测试" />*@
         </RowButtonTemplate>
         @*<TableColumns>
        <TableColumn @bind-Field="@context.Hobby" Items="GetHobbys(context)" />
        </TableColumns>*@
     </Table>
 </div>